/*
 * @Author: 大淘客开放平台验签SDK
 * @Date: 2019-06-19 11:44:24
 * @LastEditTime: 2021-09-24 15:45:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /www/NodeSDk/src/index.js
 */
// const dtkSdk = require('../dist/index');
// const dtkSdk = require('../src/index');

const dtkSdk = require('../src/index');
/*  
 *  初始化 service
 *  @appKey: 用户填写 appkey
 *  @appSecret: 用户填写 appSecret
 */
const sdk = new dtkSdk({  appKey: '605ff2f017bf0',  appSecret: '92c3da92f689b0c5667fcac66990d029'});

/*
 *  基础工具API
 */

/*
 *  1、高效转链
 *  API地址: https://www.dataoke.com/kfpt/api-d.html?id=7
 *  @version: API接口版本号
 *  @goodsId: 淘宝商品id
 */
// sdk.service.getTbServiceGetPrivilegeLink({  
//   version: 'v1.3.1',  
//   goodsId: 'Y7xXyYzSpt5yw7PfW0JFQU6-eQGMq6ACGG3wbMwZs9Q',  
//   pid:'mm_128253859_2255800262_111239000357',  
//   channelId: '2992888033'
// }).then((res) => {
//   console.log(res, '接口调用成功')
// }, (error, body) => {
//   console.log(error, '接口调用失败');
// });

sdk.service.getPromotionUnionConvert({  
  version: 'v1.2.3',  
  goodsId: 'ANXebJQhDC4r7KBp7ztJbQivtn-abKbp7hd98A9dQDHgo',  
}).then((res) => {
  console.log(res, '接口调用成功')
}, (error, body) => {
  console.log(error, '接口调用失败');
});

